import request from '../utils/request'

export const GetTasksList = (params) => {
  return request('/api/tasks', {
    params
  })
}

export const GetTaskDetail = (id) => {
  return request(`/api/tasks/${id}`)
}

export const DeleteTask = (id) => {
  return request(`/api/tasks/${id}`, {
    method: 'delete'
  })
}

export const CreateTask = (data) => {
  return request('/api/tasks', {
    method: 'post',
    data
  })
}

export const UpdateTask = (id, data) => {
  return request(`/api/tasks/${id}`, {
    method: 'put',
    data
  })
}